All Questions
13 questions
1vote
2answers
217views
physical simulation: design thoughts
I'm an applied physics student and currently working on a simulation of the magnetic interactions of multiple protons within a protein. Me having only little experience with programming and almost ...
0votes
2answers
177views
Encoding const-ness on interfaces. Readers - Writers vs Const wrapper
This question is based on this separate question on stack overflow. I have a very low-level structure meant to compactly save presets on flash memory. For simplicity I am going to use stored_record as ...
1vote
1answer
262views
Decoupling from third party library
I'm doing a project in PHP and I'm implementing Aggregates and Event Sourcing. In order to avoid coding up all the logic related with ES myself I've decided to use a third party library called ...
0votes
2answers
1kviews
Add method to interface for only one implementation
I have a factory for an interface with different implementations. But one implementation needs an extra method which the others don't need. How do I solve this without implementing "not implemented ...
0votes
1answer
174views
software design for a class utilizing many different services
I am trying to model a design for a C# project. Trying to follow the SOLID principles, this is what I've got so far: SDKClient class which has three (for this explanation) important properties (...
3votes
1answer
184views
Leo Brodie's "Interface Component"
On page 85 of Leo Brodie's book, Thinking Forth, he describes a component which he calls the "Interface Component." He describes its differences from, and benefits over a standard interface ...
16votes
2answers
2kviews
Principle of least astonishment (POLA) and interfaces
A good quarter of a century ago when I was learning C++, I was taught that interfaces should be forgiving and as far as possible not care about the order that methods were called since the consumer ...
2votes
1answer
617views
Define an object with the interface as a type instead of class name [duplicate]
I try to practice with the design patterns and explore one of the possible implementations of the Observer Design Pattern in Java. I paid attention, that in this example the object is defined with the ...
-4votes
2answers
192views
Advantages of these recommendations in ooprogramming using Java
Below are the recommendation from section 5.1 of this essay. While Java is not a pure object-oriented language, it is possible to program in a pure object-oriented style by obeying the following ...
3votes
1answer
1kviews
Creating an interface just to decouple from third party libraries
I'm currently developing the Authorization module on a framework of mine. I have the following class so far: public interface IAuthorizationManager<C> where C : ...
9votes
4answers
5kviews
How to force "program to an interface" without using a java Interface in java 1.6
In java 1.8 they have wonderful new "default interface methods". In 1.6 how close can we come? The goal: use code to keep clients from being able to tell that a class is not a java interface. If we ...
1vote
1answer
1kviews
Static methods vs Interface implementation
Here is my problem: I stared to create an e-commerce web site info collector. So I created a parser for each site. The parser class is stateless. I have got methods like: getItemPrice(WebElement ...
1vote
1answer
2kviews
How to generalize a classes that has identical function plus some additional function
I have some designing problems with my project. To illustrate my problem, I'll use the following two classes from my project. public class RAM_UserManagement{ private Map<int,User> userList; ...